package com.xtx.util;

import java.util.regex.Pattern;

/**
 * User: hanyi
 * Date: 12-2-8
 * Time: 下午2:24
 */
public class RegularUtil {
    public final static String REG_AMOUNT = "(\\d{1,7})(\\.\\d{1,2})?";

    public static boolean isEmail(String email) {
        if(email == null){
            return false;
        }
        String regex = "^([a-z0-9A-Z]+[_|\\-|\\.]*)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        if (Pattern.matches(regex, email)) {
            return true;
        } else {
            return false;
        }
    }
}
